<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
  <link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
</head>
<body>
<?php 
  $id=$_GET['id'];
  $row=$data['foods'];
  $foodname=$row['foodname'];
  $tid=$row['tid'];
  $intro=$row['intro'];
  $address=$row['address'];
  $pic="upload/".$row['pic'];
// 将查询结果显示在表单中
     ?>
     <form method="post" action="admin.php?c=food&m=update" enctype="multipart/form-data" class="form-horizontal" >
 
     
     <h1 align="center" style="margin-right:20px">修改美食信息</h1>
      
      <div class="container-fluid col-md-12">  
      <input type="hidden" name="id" value=<?php echo $id; ?>>
      
    <div class="form-group">
    <label for="foodname" class="col-md-4 control-label">美食名称</label>
    <div class="col-md-4">
    <input type="text" id="username" name="foodname" class="form-control"
        value=<?php echo $foodname; ?>>
    </div>
  </div>
  
  <div class="form-group">
    <label for="" class="col-md-4 control-label">类别</label>
    <div class="col-md-4">
    <select  name="tid" class="form-control">
            <option value="0">请选择</option>
            <option value="1" <?php if($tid=='1') echo 'selected'; ?>>川菜</option>
            <option value="2" <?php if($tid=='2') echo 'selected'; ?>>徽菜</option>
            <option value="3" <?php if($tid=='3') echo 'selected'; ?>>鲁菜</option>
            <option value="4" <?php if($tid=='4') echo 'selected'; ?>>闽菜</option>
            <option value="5" <?php if($tid=='5') echo 'selected'; ?>>苏菜</option>
            <option value="6" <?php if($tid=='6') echo 'selected'; ?>>湘菜</option>
            <option value="7" <?php if($tid=='7') echo 'selected'; ?>>粤菜</option>
            <option value="8" <?php if($tid=='8') echo 'selected'; ?>>浙江菜</option>
          </select>
    </div>
  </div>
   

  
  <div class="form-group">
        <label class="col-md-4 control-label">美食简介</label>
        <div class="col-md-4">
          <textarea name="intro" cols="40" rows="5" class="form-control" placeholder="美食简介"><?php echo $intro; ?></textarea>
        </div>
      </div>
  <div class="form-group">
  <label  class="col-md-4 control-label">图片</label>
  <div class="col-md-4">
    <input  type="file" name="pic" >
    原图片:<img src="upload/<?php echo $row["pic"]; ?>"width="80px" height="80px" class="img-circle"value=<?php  echo $pic;  ?>>
  </div>
  </div>
  <div class="form-group">
      <div class="col-sm-offset-4 col-sm-6">
          <input type="submit" class="btn btn-success" value="更新">
          <input type="reset" class="btn btn-primary" value="重置">
      </div>
  </div>
  </form>
  </div>
</body>
</html>